package com.zboin.ucenter.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zboin.ucenter.model.Permission;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author zhboom
 * @date 2025/8/4 23:17
 */
@Mapper
public interface PermissionMapper extends BaseMapper<Permission> {

    @Select("select * from user_center.role_permit rp " +
            "left join user_center.permission p on p.permit_id = rp.permit_id " +
            "where rp.role_id = #{roleId} and p.is_valid = 1;")
    List<Permission> getPermissionByRoleId(Integer roleId);
}
